import { Injectable } from '@angular/core';

import {FrameContext,BindingData,Repository} from '@farris/devkit';
import { CommandService,DialogService } from '@farris/command-services';
import { ModalOptions } from '@farris/ui-modal';

@Injectable()
export class SbssDzyhpKcMxFrmControllerService {
  constructor(
        private dialogService: DialogService,
        private frameContext: FrameContext,
  ) {}

  /**
   * 点击单据超链接
   * @remarks 
   * @param trasType 单据类型
   * @param djid 单据ID
   * @returns 
   */
  djCodeLinkedLabelClick(trasType:string,djid:string): any {
    // 获取当前选中的数据
    let modeId = ''
    let title = ''

    // 0 申请 1互转 2报废 3初始化
    switch (trasType){
      case '0':
        modeId = 'modalcontainer_0302'
        title = '易耗品申请'
        break;
      case '1':
        modeId = 'modalcontainer_0091'
        title = '易耗品互转'
        break;
      case '2':
      default :
        modeId = 'modalcontainer_3369'
        title = '易耗品报废'
    }
    
    let options: ModalOptions = {"width":1200,"height":800,"title":title,"areaResponse":true}
    let params = {"action":"LoadAndView1","id":djid}
    
    this.dialogService.openModal(options,modeId,params)
  }
}
